//user
export interface UserInfoType {
    birthday?: string
    createTime: string
    email: string
    gender?: string
    headImg: string
    id: number
    loginName: string
    name: string
    nickName: string
    openId?: string
    operateTime?: string
    passwd: string
    phoneNum: string
    status: number
    userLevel: string
}

//home
export interface CategoryType {
    categoryChild?: CategoryType[]
    categoryName: string
    categoryId: number
}

export interface BannerType {
    id: string
    imgUrl: string
}

export interface FloorType {
    id: string
    name: string
    keywords: string[]
    imgUrl: string
    navList: {url: string; text: string}[]
    carouselList: {id: string; imgUrl: string}[]
    recommendList: string[]
    bigImg: string
}

//search
export interface TrademarkType {
    tmId: number
    tmName: string
}

interface GoodsType {
    id: number
    defaultImg: string
    title: string
    price: number
    createTime?: string
    tmId?: string
    tmName?: string
    category1Id?: string
    category1Name?: string
    category2Id?: string
    category2Name?: string
    category3Id?: string
    category3Name?: string
    hotScore: number
    attrs?: string
}

export interface AttrsType {
    attrId: number
    attrValueList: string[]
    attrName: string
}

export interface SearchType {
    trademarkList: TrademarkType[]
    attrsList: AttrsType[]
    goodsList: GoodsType[]
    total: number
    pageSize: number
    pageNo: number
    totalPages: number
}

//detail
interface CategoryView {
    id: number
    category1Id: number
    category1Name: string
    category2Id: number
    category2Name: string
    category3Id: number
    category3Name: string
}

export interface SpuSaleAttrValueType {
    id: number
    spuId: number
    baseSaleAttrId: number
    saleAttrValueName: string
    saleAttrName: string
    isChecked: '0' | '1'
}

interface SpuSaleAttrType {
    id: number
    spuId: number
    baseSaleAttrId: number
    saleAttrName: string
    spuSaleAttrValueList: SpuSaleAttrValueType[]
}

interface SkuImageType {
    id: number
    skuId: number
    imgName: string
    imgUrl: string
    spuImgId: number
    isDefault: '0' | '1'
}

interface SkuAttrValueType {
    id: number
    skuId: number
    attrId: number
    attrName: string
    valueId: number
    valueName: string
}

interface SkuSaleAttrValueType {
    id: number
    skuId: number
    spuId: number
    saleAttrId: number
    saleAttrName: string
    saleAttrValueId: number
    saleAttrValueName: string
}

interface SkuInfoType {
    id: number
    spuId: number
    price: number
    skuName: string
    skuDesc: string
    weight: string
    tmId: number
    category3I: number
    createTime: string
    skuDefaultImg: string
    isSale: number
    skuImageList: SkuImageType[]
    skuAttrValueList: SkuAttrValueType[]
    skuSaleAttrValueList: SkuSaleAttrValueType[]
}

export interface GoodInfoType {
    valuesSkuJson: string
    price: number
    categoryView: CategoryView
    spuSaleAttrList: SpuSaleAttrType[]
    skuInfo: SkuInfoType
}

//shopcart
export interface CartInfoType {
    id: number
    cartPrice: number
    couponInfoList: null
    createTime: string
    imgUrl: string
    isChecked: number
    isOrdered: number
    operateTime: string
    orderTime?: string
    skuId: number
    skuName: string
    skuNum: number
    skuPrice: number
    sourceId: number
    sourceType: string
    userId: string
}

export interface CartType {
    activityRuleList: null
    createTime: string
    cartInfoList: CartInfoType[]
}

//trade
export interface AddressType {
    id: number
    consignee: string
    fullAddress: string
    isDefault: string
    phoneNum: string
    provinceId: number
    regionId: number
    userAddress: string
    userId: number
}

import {OrderDetailType} from '@/api/types'

export interface OrderInfoType {
    activityReduceAmount: number
    couponInfoList: null
    detailArrayList: OrderDetailType[]
    orderDetailVoList: {
        activityRule: null
        orderDetailList: OrderDetailType[]
    }[]
    originalTotalAmount: number
    totalAmount: number
    totalNum: number
    tradeNo: string
    userAddressList: AddressType[]
}
